package com.zpark.controller;

import com.zpark.entity.User;
import com.zpark.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;


import java.util.List;


@RestController
public class UserController {

    @Autowired
    private UserRepository userRepository;

    // 查找所有user对象
    @GetMapping("findall")
    public List<User> findall(){
        List<User> userList=userRepository.findAll();
        return userList;
    }
}

